package 设计模式.观察者模式.ApplicationContext事件监听;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * @author 孔令富  2021/10/21
 */
public class SpringContextTest {
    public static void main(String[] args) {
        ApplicationContext context = new ClassPathXmlApplicationContext("spring-event.xml");

        context.publishEvent(new MessageEvent("hello"));  //会再触发一次

    }
}
